import request from '@/utils/request'

// 获取部门列表数据
export const getdepartmentsAPI = () => {
  return request.get('/company/department')
}

// 删除部门数据
export const deldepartmentsAPI = (id) => {
  return request.delete(`/company/department/${id}`)
}
/**
 * 获取部门负责人列表
 * @returns
 */
export const getUserSimpleAPI = () => {
  return request.get('/sys/user/simple')
}
/**
 * 添加部门接口
 * @param {*} form 点击确定提交的表单数据
 * @returns
 */
export const setUsersimpleAPI = (form) => {
  // return request({
  //   url: '/company/department',
  //   method: 'POST',
  //   data: form
  // })
  return request.post('/company/department', form)
}
/**
 * 封装获取单个部门信息接口用来做数据回显
 * @param {*} id  部门id
 * @returns
 */
export const editUsersimpleAPI = (id) => {
  return request.get(`/company/department/${id}`)
}
/**
 * 编辑部门接口
 * @param {*} data 传递给接口的数据
 * @returns
 */
export const editXiugaiAPI = (data) => {
  return request.put(`/company/department/${data.id}`, data)
}
